Welcome

Welcome.gif, 2464 bytes
1998 - 2008 © Carthago Software

Twistpad is a not only a strong notepad replacer, but also a excellent editor primary targeting web and software developers

Main Features

  • Compatible with Windows 2000/XP/2003 Server/Vista (both 32 and 64 bits editions)
  • Unlimited file size and document windows (Hardware dependent)
  • Easy to edit custom powerful syntax highlighting for computer languages and scripts
  • Unicode support
  • Copy/Export as RTF and HTML
  • Unlimited undo and redo
  • Built-in difference tool for comparing two files
  • Line bookmarks
  • Fast opened documents switch (like the Windows Taskbar)
  • Search/Replace in files
  • Configurable Toolbar
  • Print Preview
  • No shared DLLs, ActiveX controls or other system files are installed*
  • No bulky runtimes or virtual machines are required
  • and many more features...
* Additional add-ons may require installation on system folders

Getting Help

To browse help, start by selecting an item on the left tree

© 1998 - 2008 Carthago Software. All rights reserved.


Registration

Twistpad is distributed as Shareware. You can freely download and try it for 30 days.
If you find it useful and decide to keep it over 30-day evaluation period, you should pay the registration fee.

The registration of Twistpad costs $19.95 per user.

Orders

Please visit the Carthago Software Web site for latest information on registering Twistpad

Why Register?

  • Free priority technical support by e-mail and Carthago Web Site Forum
  • Free upgrades on service releases and minor versions
  • Discounts on major new versions
  • Encourage the authors to improve Twistpad
  • Removes 30 day limit
  • Removes startup dialog
  • Help support low cost software industry


Feedback and Support

Twistpad on the Web

Latest versions and information can be found at the Carthago Software Web site.

There you can join our forums for support and questions you may have on Twistpad.

Contacting us directly is possible, but we recommend to browse the forums, since your question or problem may already been addressed.


License Agreement

SOFTWARE LICENSE AGREEMENT

1.NOTICE TO USER:
THIS IS A CONTRACT. BY INSTALLING THIS SOFTWARE YOU ACCEPT ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. This Carthago Software ("CARTHAGO") End User License Agreement (EULA) accompanies all Non-Freeware CARTHAGO products and related explanatory materials ("SOFTWARE"). The term "SOFTWARE" shall also include any upgrades, modified versions or updates of the Software licensed to you by CARTHAGO. Please read this License Agreement carefully. If you are reading this prior to electronic distribution, you will be asked to accept this agreement and continue to install or, if you wish to decline this agreement, in which case you will not be able to use the Software.

The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is licensed, not sold.

2.GRANT OF LICENSE
Upon issuance on information on how to obtain the licensed version of the SOFTWARE by CARTHAGO to you, this License Agreement grants you the following rights:

a. SOFTWARE PRODUCT : CARTHAGO grants to you as an individual, a non-transferable, nonexclusive license to use the SOFTWARE PRODUCT as follows:

IF YOU PURCHASED A SINGLE USER LICENSE - One registered copy of this software may either be used by a single person who uses the software personally on one or two computers, or installed on a single workstation used non simultaneously by multiple people, but not both.

IF YOU PURCHASED MULTIPLE USER LICENSES - Usage is restricted to a company or/and a corporation or/and an enterprise or/and an organization. Installation and use of the SOFTWARE PRODUCT on both desktops and notebooks is limited to the specified number of licensed copies.

IF YOU PURCHASED A SITE LICENSE - Usage is restricted to a company or/and a corporation or/and an enterprise or/and an organization. Unlimited number of computers of/within this site including both desktops and notebooks are allowed to install the SOFTWARE PRODUCT.

REGISTERED USERS OR/AND COMPANY OR/AND A CORPORATION OR/AND AN ENTERPRISE OR/AND AN ORGANIZATION ARE PROHIBITED TO DISTRIBUTE THE RETAIL LICENSED VERSION OF THE SOFTWARE TO OTHER PERSONS OR/AND COMPANIES OR/AND MAKE AVAILABLE TO THE GENERAL PUBLIC THROUGH THE USUAL SOFTWARE CHANNELS.

b. All above licenses include priority software support for the current major version.

EVALUATION VERSION - You are allowed to use this software for 30 days for evaluation purposes without any charge. If you find the software useful and want continue using it, you must register it. Otherwise, you must delete (uninstall) this program from your computer. To register your copy of software, see program's help.

c. Software support is available on a limited basis for the evaluation version.

3. Support Services
CARTHAGO provide you with support services related to the SOFTWARE PRODUCT ("Support Services"). The provision and use of Support Services is governed by the CARTHAGO policies and programs described in the SOFTWARE PRODUCT user manual and/or in "online" documentation. In any case shall CARTHAGO have obligation to provide maintenance, support, upgrades or new releases to the SOFTWARE PRODUCT other than at it's own discretion.

4. COPYRIGHT:
The SOFTWARE is owned by CARTHAGO and its suppliers, and its structure, organization and code are the valuable trade secrets of Carthago and its suppliers. The SOFTWARE is protected by United States Copyright Law and International Treaty provisions, this License Agreement does not grant you any intellectual property rights in the Software.

5. RESTRICTIONS:
General Limitations - You may not resell, transfer, rent or lease the SOFTWARE. You agree not to modify, adapt, translate, reverse engineer, decompile, disassemble or otherwise attempt to discover the source code of the Software. You may not alter or modify in any way the installer for the Software, or create a new installer for the Software. Any such unauthorized use shall result in immediate and automatic termination of this license and may result in criminal and/or civil prosecution.

Termination - Without prejudice to any other rights, CARTHAGO may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts.

6. NO WARRANTY:
The SOFTWARE is being delivered to you AS IS and CARTHAGO makes no warranty as to its use or performance. CARTHAGO AND ITS SUPPLIERS DO NOT AND CANNOT WARRANT THE PERFORMANCE OR RESULTS YOU MAY OBTAIN BY USING THE SOFTWARE OR DOCUMENTATION. CARTHAGO AND ITS SUPPLIERS MAKE NO WARRANTIES, EXPRESS OR IMPLIED, AS TO NONINFRINGEMENT OF THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL CARTHAGO OR ITS SUPPLIERS BE LIABLE TO YOU FOR ANY CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS OR LOST SAVINGS, EVEN IF AN CARTHAGO REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY. Some states or jurisdictions do not allow the exclusion or limitation of incidental, consequential or special damages, or the exclusion of implied warranties or limitations on how long an implied warranty may last, so the above limitations may not apply to you.

7. If in doubt, contact Carthago Software directly via it's web site at http://www.carthagosoft.net


Acknowledgments

The Twistpad team, would like to thank the following people who helped in the development of Twistpad
  • Raymond Courteau
  • Joel Paula
  • Jordan Russel
  • Alex A. Denisov
  • Andrey V. Sorokin
  • Zhouyibo
  • Mike Lischke
  • Egbert van Nes
  • NullSoft (NSIS Installer)


Creating a new file

To create a new file in Twistpad, click the New button on the toolbar. A new window will created in memory. To locally save the file after editing, use Save or the Save As Command.

If you use the New command on the file menu, a dialog will offer you the option to open a syntax ready document, or let you choose from the template list.


Opening files

To open an existing file, click the Open toolbar button or select File > Open.

Browse for the file you want in the open file dialog and press open.

Tip: A history button is located at the bottom of the dialog. Pressing it will display a list of recently locations of past opened files. This is useful to recall your recently used folders.

Tip: You can use the File Browser window to open files instead of the open dialog.


Search Results Window

Twistpad uses the MDI (multiple document interface) concept.
This allows multiple documents to be opened at the same time which can be switched to easily with the switch bar:

Basically MDI allows each document to be a edit window inside the Twistpad window.
You can work with the document windows in the Window menu, allowing cascading, minimize or close all.


Window Organizer Dialog

Window Organizer allow to select or close documents currently through a list of currently all the loaded documents in Twistpad.
Search can be done by using the top box, all fields found in the search text are instantly displayed. Deleting the search text shows all loaded documents.

The list of columns is the following:
# | The order number of the document loaded in Twistpad
Name | Filename (without path)
Modified | Is the document modified?
Read Only | Is the document read only?
Extension | Is the document file type
Lines | Total of number of lines in the document
Path | The document path

Multiple documents can be closed, by using either the mouse or select + Ctrl key

Note: a red line, means the document is modified, and blue means the document is read only on disk. if a line is bold, it means that this file is in the current opened project.


Properties Dialog

The Properties dialog shows properties about the file and statistics about the document.
The Read Only attribute of the file can be set, as well as the EOL mode.


Open With Dialog

You can open a document in one or more editors by selecting Open With on the Tools menu.

Use the list presented with the editors available, or choose Add to include a new editor in the list.
After selecting a editor, press Open and the active document will then open in the selected editor.


Find In Files Dialog

Find in Files allows searches in multiple files for a matching word or phrase in one or mores folders.

Search Options
  • Whole Words Only - if checked, only text that is a word is searched.
  • Match Case - if checked, the search will take the words case into consideration, eg: CAse is not the same as case.
  • Regular Expression - if checked, the search terms will be based in regular expressions.
More Options
  • Look in - Allows the selection of target dir where are the files to be searched. Use the browse button to look for a folder or open the "Select Folders" manager to specify multiple folders.
  • Include sub-folders - If checked the search will include all folders under the main folder.
  • Search in current opened Files - If checked no target folder(s) is required, instead the search will be made on the currently opened files in Twistpad .
  • Search in current project - If checked, again no target folder(s) is required, instead the search will be made on the files of the selected project.
In Files
Allows to choose the mask with wildcards to filter the files

the results of the search will be available in the Search Results Window


Replace In Files Dialog

Find in Files allows replacing words or phrases in multiple files in one or mores folders.

Search Options
  • Keep modified files opened after replace - If checked, all files that have been processed in the replace process, will be opened with the changes and ready for save (this option is recommended for safety reasons).
  • Whole Words Only - if checked, only text that is a word is searched.
  • Match Case - if checked, the search will take the words case into consideration, eg: CAse is not the same as case.
  • Regular Expression - if checked, the search terms will be based in regular expressions.
More Options
  • Look in - Allows the selection of target dir where are the files to be searched. Use the browse button to look for a folder or open the Select Folders manager to specify multiple folders.
  • Include sub-folders - If checked the search will include all folders under the main folder.
  • Search in current opened Files - If checked no target folder(s) is required, instead the search will be made on the currently opened files in Twistpad .
  • Search in current project - If checked, again no target folder(s) is required, instead the search will be made on the files of the selected project.
In Files
Allows to choose the mask with wildcards to filter the files

the results of the search will be available in the Search Results Window


Customizing Twistpad

The Toolbar, the Editor Context Menu and Keyboard shortcuts can be customizable for your needs.
Clicking Tools > Customize... a customization dialog will appear with three distinct areas.

Toolbar
You can customize the main toolbar and an optional user toolbar*, for easy and fast access to frequently used commands.
The list represents the current selected items, press add to add any new command available in Twistpad or remove, to remove the currently selected command, you can also add a separator and move the selected item up or down

* The user toolbar is not visible by default and requires to be enabled using the View-User Toolbar command in the Twistpad main window

Context Menu's
There are three kind of context menus in Twistpad. Editor, Tab and Toolbars / Switch bar.
this context menu's are accessible by clicking with the right mouse button, in the editor (Editor Menu), Tab (in the tab of the document in the switch bar) and the Toolbars / Switch Bar menu is accessible via right click on either the toolbar or an empty part of the Switch Bar.
the selection of commands is similar to the toolbar.

Keyboard
The Keyboard tab allows Keyboard shortcuts for each command to be customized.

Options
Use high color icons
When checked, Twistpad will use icons for images with 32 bit resolution, this requires at least a graphics card with 16 million colors

Smooth progress bars
When checked, the style of progress bars will be a smooth block instead of multiple blocks

Multi-Row toolbars
When Checked, the toolbars will be wrapped at the end of the window and continue below. With this option a chevron is used to display the hidden commands


Calculate Expression Dialog

Twistpad Help

Closing Files

When closing Twistpad or invoking the Close All Documents or Close All Documents Except This commands, if there are any modified files in the current session, instead of going through each one asking to save (like when closing a document individually) Twistpad displays a window with a list of the modified files

This dialog gives the user the ability to select which files should be saved (by selecting in the list files which may be saved) and unselecting the ones the user does not which to save.

To select multiple documents press the Control key and click on the document, that way the previous selection will be kept.
to unselect press the Control key and select a selected document.

Pressing Yes will save the selected files, pressing No will not save any file regardless of selected document. Cancel will cancel the close action without closing any document (nor saving)


Find Dialog

Twistpad Help

Find/Replace Dialog

You can search for a word or specific text in the active document by selecting find in the search menu, or the click the find toolbar button.

Additionally pressing the replace button will present the replace dialog, which works in the same manner as the find dialog but allows the found word to be replaced by the one specified in the "Replace With" text box

Direction
Choose the direction to perform the search.

Options
  • Match Whole Word - if checked, only text that is a word is searched.
  • Match Case - if checked, the search will take the words case into consideration, in this case CAse is not the same as case.
  • Regular Expression - if checked, the search will use regular expressions. (Please note only the search box contents are parsed for regular expressions. The replace box is not R.E. aware)
  • Wrap Search's - if checked, the search will continue after passing the end of the document.
More button
  • Find all - Finds all occurrences of the search term in the current document (results displayed in search results)
  • Find in all documents - Finds all occurrences of the search term in all documents (results displayed in search results)
  • Highlight all - Highlights the search search term in the current document
  • Bookmark all - Bookmarks all lines where the search search term is found in the current document
Bookmarks all lines in the active document which satisfies the search.

Replace All
This command will replace all found text with the text on the replace with text box at once (instead of replacings one by one. Please note if Wrap Search is checked, the replace will occur from the start of the document

In Selected text only
If checked, text will only be replaced in the current text selection


Calculate Expression Dialog

Calculate Expression allow a numeric expression to be calculated.

Simply select a block of text like, for instance, 10+20 and press the Calculate Expression command in the menu or the editor context menu
The result will be displayed in the Output Window as shown in the image below:

Note: The multiply simbol is * and the division symbol is /


Goto Dialog

The Goto dialog allows to quickly jump to a line or specific marks in the text.

  • Line: Specify the line to jump to in the edit box
  • Column: Specify the column to jump to (in the current selected line of the cursor) in the edit box
  • Bookmark: Using the Next or Previous buttons, jump to Next/Previous bookmark*
  • Function: Using the Next or Previous buttons, jump to Next/Previous Function*
  • Modified line: Using the Next or Previous buttons, jump to Next/Previous modified*
  • Search highlight: Using the Next or Previous buttons, jump to Next/Previous search highlight (used in a search in files)
    • * Cursor may be wrapped in the text (top/bottom) if needed.

    If extended selection is checked, it means that from the current cursor position, to the new selected position, text will be selected.


Sort Dialog

The Sort Dialog allows text in the active document to be sorted.

Sorting Order Specifies the sorting direction:
  • Ascending - ABCDE...
  • Descendig - ZYXW...

Text Specifies which text is sorted:
  • All Text - All text in the active document will be sorted.
  • Selected Text - Only the selected text in the active document will be sorted.
  • From Cursor - All text from the cursor position onwards will be sorted.

Sort on Specifies on which part of the line text is sorted
  • Beginning of Line - All the line is used for sorting.
  • Part Of Line - specifies where, in the line, to start the sort criteria in character count.
  • Field - Treats lines as records, and fields will be recognized with the delimiter
    eg: 12;32;43;53;34
    delimiter is ";" field #2 value is 32

Options
  • Treat Fields as Numeric - When specifying fields as a sort method this options treat and expect the fields as numeric values.
  • Ignore Leading Blanks - Leading blanks will be ignored.
  • Ignore Case - Ignores text case when comparing sorting.


List Functions Dialog

The Functions Dialog allows functions to be quickly identified in the active document.

This functions are defined in the syntax definition of the opened file.
For more information on definition of sections, refer to the syntax definition files topic

Text can be typed in the text box in order to further filter the results.
double click or click Jump To to go to the selected line.


Bookmarks

Bookmarks allow a line or various lines in the document to be marked, so it can be easily returned to at a later time

to set a bookmark, move to the desired line and press Ctrl-F2 or use the toolbar or the menu (Pressing it again removes the bookmark)

Use F2 and Shift-F2 to goto next or previous bookmark.

To clear all set bookmarks press Ctrl-Shift-F2 or use the toolbar or the menu.

To List all bookmarks currently set on the active document, press F9. A dialog with a list containing all bookmarked lines:

Text can be typed in the text box on the top in order to further filter the lines.

Please keep in mind that all keyboard shortcuts can be modified in Customize Dialog.


Spell Checker

The spell checker helps you verify the spelling of the text of the current document.
When Pressing the Spelling button or Spelling... from the Tools menu, a dialog will pop-up and ask prompt suggestions on misspelled words:

Easier to use, and more powerful is the Active Spelling feature of Twistpad.
when enabled (Tools > Active Spelling) instead of a pop up dialog, the misspelled words will be underlined by a dotted red line:

To correct the misspelled word, click with the right mouse button, and a menu with suggestions will popup, choose one from the list to correct the word, or click anywhere on the text to close the menu.

One of the most interesting features of spelling on Twistpad is that you can customize where the speller should be active. for instance if you have an HTML file you surely do not want the spell checker to constantly prompt for errors on words inside tags! This can be archived with Twistpad's syntax definition files

The spell checker languages can be chosen in the Spell Checker Options under the Tools menu.
Additional languages are available in the Carthago Software web site


Compare Files Dialog

Twistpad features a built in utility to compare files differences in two text files.

After invoking the Compare Files command, choose two files locally saved in any folder using the respective browse button.

Additionally you can select files currently being edited in Twistpad. Internal file are recognized by their single name and between brackets eg: [somefile.txt]. This can be useful for comparing a currently editing session with the contents of the same file saved on disk.

Pressing the "More" button reveals the compare options available:
  • Ignore case: Text case will not be taken in account comparing the text
  • Show syntax highlight: If documents have an associated syntax definition, the syntax turned off in the both compare window documents.
  • Ignore Blanks: Blank lines will not be taken in account comparing the text

Refer to the Files Compare topic for more information.

Note : The syntax highlight option is not available in the 30 day trial version of Twistpad.


Auto Complete

Pressing Ctrl-Space in the editor window will pop-up the Auto complete list box.

This feature allows the quick retrieve of reserved words (of the current syntax), files and folders in the same folder as the document, and backward words already typed in the document.

Please note that this option needs to be enabled in the Preferences Dialog.


Working with tool windows

There are two types of windows in Twistpad; tool windows, and common document windows which represent open/new files.

Tool windows can be docked to the main window, or float above it. This is archived simply by dragging the window to the desired window via it's caption.

When docked to the main window, Layout windows can be joined together via tabs, side by side or hidden.

Simply try dragging the windows and find a position which best suits your work space.

All tool windows can be toggled on or off via the menu View.


Bookmarks Window

The bookmarks window holds a list with all bookmark set in all documents in the current session of Twistpad.


Clipboard Window

Twistpad Clipboard Window will collect items as you copy and cut to the clipboard.
Each item will then be available to be pasted or dragged into the current document

Note - Items are only collected if the Clipboard Window is visible.
To set the Clipboard Window visible, on the view menu, select Clipboard Window


File Browser Window

The File Browser Window allows to browse your disk without having to open a new explorer window or open a file.
You can select the root of your working folder, and all files are available to open or even manage (delete, move, etc)

Working with the File Browser Window:
Allows to navigate to a higher folder in the folder structure.
Browse for a folder to set the root of the File Browser Window
Set the extension filter
Reset the extension filter (show all files)
Favorites Menu, add or recall your common used folders
Refresh the list contents

Note: You can open multiple files. Using the Mouse and the keyboard select the wanted files either using the "Control" key or the "Shift" key, right click, and select "Open" from the Menu.


Function Window

The Function Window displays all functions fount in the current document.

Functions are defined in the Syntax file definition and are dependent to the current document type

Right clicking with the mouse in the function list allows to select or bookmark a function, hide the line column or launch the search functions dialog.


Output Window

The output window displays additional information after running an external application set up in the tools configuration.

Note: When running a tool, and if set up to capture the output the current text will be replaced with a new capture.

Tips
  • If a numeric value is double clicked the active document will try to jump to the same line number.
  • A context menu is available (through right click) which displays more options with the Output Window.
    • Copy - Copy's the current selection
    • Copy All- Copy's all text available.
    • Transfer to a new editor window - Create's a new document window with the current text,
    • Clear - Clear's all current text.


Project Windows

Twistpad Help

Project Window

The Project Window shows the current project files as they been set up.
Double click on a file to open in the editor.

The Toolbar allows to work with the current project:

New Project | Creates an empty Project file.
Open Project | Opens an existing Project file.
Save Project | saves current opened Project.
Save Project As | saves current opened Project under a new file.
Organize Project | Opens the Project dialog
Close Project | Closes the current opened Project


Snippet Window

Twistpad snippet window will display's all snippets available.
Each item is available to be dragged (or via double-click) into the current document

To set the Snippet Window visible, on the view menu, select Snippet Window


Search Results Window

The Search Results Window will be activated after a Find in Files command is invoked.
Only files that met the criteria configured in the Find in Files dialog will be shown.

Double clicking in an item will open a new document window in the line that the search was found.

Results will be added as more search's are done, you can clear all search results or the currently selected on


Workspace Window

The Workspace Window lists all currently opened documents in Twistpad.
To switch between opened documents, click on the desired item and it will be switched.

Two kind of sorting can be archived:
  • Alphabetically
  • By Folder

&#169; 1998 - 2008 Carthago Software. All rights reserved.


General Preferences

Allow multiple instances
If checked, Twistpad can be opened with multiple instances (independent Twistpad windows).
If this option is not selected, if a Twistpad window is currently active, it will be reused if a file is launched in Explorer.
Please note that when changing this option, it's required to restart Twistpad in order to take effect

Maximize window on open
If checked, every document window (opened or created new) will be maximized automatically.

Close all opened files when loading from workspace
If checked, When Loading a workspace file, all currently opened documents will be closed.

Use enhanced document switch
Allows to switch opened documents using Ctrl+Tab in a similar style to the alt+tab behaviour in Windows. (A window will show all the open documents and easily select the preferred one
if unchecked, Ctrl+Tab will select the next document in the order they have been opened/created and Shift+Ctrl+Tab will select the previous document.

Middle button click in tab closes document
If checked, using the middle mouse button in the respective tab in the switch bar, closes the document

Maximum items to hold on internal clipboard:
Specify the maximum number of items the internal clipboard should remember

Reactivate dialogs
Reset's "don't show again" options of some dialog box's


Font Preferences

This Screen allows you to change the font for the Twistpad application.

  • Editor: Main editor font
  • Print: Font used for printing purposes
  • Gutter: Font for line numbers in the gutter
  • Output: Font for the output window

Please note that proporcional fonts (better suited to programming languages) are displayed in bold.


Printer Preferences

Show Line Numbers
if checked, the line numbers will be printed

Wordwrap
if checked, the text will be wrapped at continue on the next line. Please note that, if the WordWrap option is not selected, long lines will be cut and will not be printed

Header and Footer
In this two text boxes, the header and the footer can be customized.
special characters can be used.

Special Char | Description
{n} | Document Name and path ex: c:\mypath\myfile
{d} | Document Name only ex: myfile
{p} | Current page number
{a} | Current date
{t} | Current time

Margins
Use this section to determine the margins on the printed page


External Tools Preferences

Providing a set of tools allows you to open another application or send the current document to an external application directly from Twistpad .
This application can be another text editor, a compiler, a special purpose editor or any application you use.

Tools can have dynamic values to fit common scenarios via standard parameters when executing another application.
In addition, the output from some tools (mostly command line tools) can be displayed in the Output Window.

The list of available tools will be available at the bottom of the tools menu.

Description
The description used on the Tools Menu

Application
The path to the external tool used to launch the current document

Parameters
Parameters to including when launching the external tool, use the Arrow button to select one or more parameters

Special code | Description
{filename} | Current document filename with path
{Single Filename} | Current document filename without the path
{Single Filename Without Extension} | Current document filename without path and extension
{Path} | Current document path (folder name only)
{Ask} | Twistpad will prompt for Parameters when launching the external tool
{selection} | Select text of the current document will be used as parameters
{Word At Caret} | Word where the caret is at in the Current document will be used as parameter

Initial Folder
Specifies the working directory of the external tool. Use the Arrow button to select the folder used:

Special code | Description
{Tool Path} | The path of the external tool
{Filename} | The path of the current document

Shortcut
Set the shortcut used to launch the external tool from the keyboard.

Capture Output
If available, the output of the external tool will be displayed in the output results window.

Save Active Document
Before Launching the external tool, Twistpad will prompt to save the current document.


Startup Preferences

Show splash screen
If checked, the splash screen will be shown at startup

Reload last workspace
If checked, all files loaded in Twistpad will restored in the next session
Please note that the last workspace will not be loaded if Twistpad detects another workspace or a file in the command line

Ask to save workspace before closing
If checked, when closing Twistpad, a dialog box asks whether the workspace should be saved and restored in the next session

Check for new version
If checked, Twistpad will contact Carthago Software server to verify if there is a new version available every time it starts.
Please note a Internet connection is required for this functionality to work correctly

Create new document
If checked, a new empty document will be created when starting Twistpad

Clean obsolete history files
If checked, invalid non-existing files will be deleted from the history of recently opened files, projects and workspaces.

Clean Now
This button will check and remove invalid non-existing files from opened files, projects and workspaces history lists

Clean All
This button will remove all files from opened files, projects and workspaces history lists


File Preferences

Open file using directory of currently active document
If checked, the folder of the current document will be used as default when opening a new file

Create Backup File
If checked, before saving a document, Twistpad will create a file with the contents prior to saving the file using the selected method (BAK extension or adding a ~ before the extension)

Detect when a document is changed outside Twistpad
If Checked, Twistpad will warn if a opened file has been changed outside Twistpad and will prompt for reload. (Please note that reloading a file may cause information to be lost)

Warn when opening a possible binary file
If checked, Twistpad will scan the first bytes of the file looking for unusual characters not usually present in a plain text file and display a warning message.

Warn when saving a ANSI file with double byte characters
If Checked, Twistpad detects if a file with (Unicode) double byte characters is saved in Ansi format.

Automatically detect UTF-8 Files without signature
If Checked, Twistpad automatically detects UTF-8 encoded Files without signature. It's strongly recommended this option is set, since, if turned off, UTF-8 Files without signature will be opened as ANSI, thus potentially losing information. If you don't use Unicode files you can switch off this option

Don't show new file dialog when selecting from the toolbar
If checked, when clicking on the New File button in the toolbar, an empty text document is created instead of showing the New File Dialog

Discard trailing spaces when saving
If checked, trailing spaces in the document are removed

Include last document folder(s) in tab display
If checked, the last folder(s) in the document path will be included in the switch bar tabs and other places alongside the filename.

Level
Select the backwards level that should be displayed

Show read only icon in tab display
If Checked, a small lock icon will be shown alongside the name in the document respective document tab.

Include full path in the title bar
If Checked, the full path of the currently selected document in Twistpad will be shown in the main window title area.


Filter Preferences

This screen allows the customization of the filters used in Twistpad open file dialog box's.


Syntax Preferences

All registered syntax's are listed here. To edit a file, double click the one you wish and it will be opened in Twistpad.
Refer to the syntax highlighting documentation for more information on how to edit Syntax Files.


File Preferences

In this section you can choose which are the default settings for syntax, End-Of-Line mode and text encoding when creating a new document.

Note: The default syntax for a new document only apply's when selecting the command "New File" via toolbar and/or the New File Dialog or when the option "Create new document at startup" is set.

Switch to wordwrap view on open/new files
If checked, all opened documents will automatically be in wordwrap mode


Compare Preferences

Ignore Case
If checked, the file compare engine will ignore case differences in the compared files.

Ignore Blanks
If checked, blank lines will not be flagged as modified

Show Syntax Highlighting
If Checked, files with associated syntax Highlighting will be highlighted.

Ignore foreground colors
If Checked, and syntax highlighting is active, the selected foreground color will not be used. Instead the default syntax highlighting will be used.

Horizontal Display
If Checked, the compare window, where the documents and differences are displayed, will be horizontal, rather then vertically.

Colors
Allows choosing the colors for added, modified or deleted lines.


Auto Recover Preferences

Auto recover allows currently opened documents to be recovered in the unlikely event of either a Twistpad or an operating system error.

The interval can be customized to suit your needs.


Editor Preferences

Left margin
The numeric input defines the editor left margin, used for text selection.

Tab stops
The numeric input the number of characters a tab stop represents.

Delimiters
The characters will delimit words.

Code outline
This option allows you enable or disable code outlining

Track changes
This option allows you to see modified lines in the current document. A yellow margin indicates that the line was edited, but not yet saved; A green margin indicates that the line was edited before the last save. Please keep in mind that the colors can be changed

Show text formatting progress
When set, whenever Twistpad needs to parse text, a message will apper in the status bar, showing the current progress.
Note: Under some scenarios, like the Find Functions command, where all the document needs to be parsed, the analysing progress will still be shown even if this option is turned off.

Restrain cursor on insert text
This option that will not reset the position of the cursor (when moving up or down) with new inserted text (please note that Show Virtual Spaces (in Editor\Display) must not be selected)

Allow text drag and drop
Allows the selected text to be dragged and dropped. To copy the selection, hold down the Ctrl key as you drag the selection.

Hide mouse cursor on type
When this option is selected, as soon text is typed in a twistpad document window, the cursor is hidden. a simple move with the mouse restores the cursor.

Smart brackets
If checked, when applying a bracket, the opposite bracket will be automatically inserted

Smooth scrolling
If checked, when scrolling text, it will display a smooth movement.

Include rich text format on Cut/Copy operations
If checked, syntax highlighting info copied to clipboard will be included in Rich Text Format

Cut/Copy operations without selection Copy/Cut current line
This option allows cut or copy text operations with requiring a selection. a Cut/Copy command is issued without a selection, the current line is cut or copied to the clipboard.

Preserve indent on paste
if checked, when pasting text, indentation will be adjusted for the current paragraph .
Please note that this option does not affect column block selections

Auto back indent
if checked, pressing BackSpace while no text is selected and the caret is at the left of the first non blank character of the line will make it take the same indentation level as the previous line.

Auto indent on new line
If checked, pressing Enter will make the new line start at the same indentation level as the previous one. If not, Enter behaves normally and the new line starts at the beginning of the paragraph.

Indent using Spaces
If checked, when using the indent feature of Twistpad spaces will be used instead of tabs.

Use spaces instead of tab
If checked, spaces will be used instead of the tab character

Smart Tabs
If checked, entering a tab character will make the caret move to the next indentation level from the previous line

Discard trailing spaces
If checked, all trailing spaces are automatically removed as text is edited.

Smart new line
If checked, Ctrl+Enter inserts a new line after the current line and Shift+Enter inserts a new line before the current line. in both cases, the cursor is set at the beginning of the new line


Editor Display Preferences

Full line select
This option is used to control how Twistpad draws selected lines when they are completely part of the selection. When not checked, selected lines are highlighted up to their right end. When checked, they are highlighted up to the right edge of the control's window.

Highlight internet links
If checked, Internet and e-mail Address's will be highlighted.

Active Internet Links
When Checked, pressing the Ctrl key while the mouse cursor is over a internet or e-mail address, will cause it to be highlighted and can be clicked to launch the default web browser or e-mail client

Highlight current line
If checked, the current line will be highlighted using a pale color. Please note this color can be changed.

Highlight brackets
If checked, when the cursor is over a bracket the matching bracket will be highlighted.
If no opposite bracket is found, it will be highlighted with the error underline color.

Show gutter
If checked, the gutter at the right of the editor is shown

Show Line Numbers
If checked, the corresponding line number will be shown in the gutter

Number all lines
If checked, all lines will be displayed, if unchecked only every tenth line number is shown on the gutter

Show ruler
If checked, a horizontal ruler will be shown on the top of the Twistpad editor

Show end of file line
If checked, a horizontal line will flag the end of the file

Show virtual spaces
If checked, spaces are inserted between the end of the line and the insertion point before new characters are added to the line. When you clear the option, the insertion point is set to the end of the line

Show function separators
If checked, function separators will be shown in the line they are found. Functions for each file type can be defined in the SDF Files definition

Show right line
If checked, a right line will be shown in the editor. This line is useful for documents that require constraint at a fixed width

Right Line Position
This numeric value determines at what character the right line is shown

Wrap at Right Line
If checked, when in wordwrap mode, the editor will wrap the text at the right line position. If not, text will be wrapped at the end of the editor width

Paint Beyond Right Line
If checked, all area after the right line will be painted in another color (This color can be set in the Editor Colors section)

Show white space
This option let the editor show non visible chars, a small line for tabs, a small point for spaces and a paragraph char for end of paragraphs

Show indentation guides
Indentation guides are thin vertical lines that appear only in whitespace areas to connect the various indentation levels of your code.

Alternate colored guides
Each vertical line will have a differect color (please note that the colors will reset in 10 by 10 column values)


Editor Colors Preferences

You can customize the editor related colors in this section.

Text
Background window and foreground text colors of the main editor

Selected Text
Background and foreground colors of the selected colors

Line Highlight
Background color used to highlight a line when Highlight Line option is set

Bracket Highlight
Background color used to highlight matching brackets when Highlight brackets option is set

Gutter
Background and foreground (line numbers) colors the gutter

Track Changes Before Save
Color to display in left margin when a a change is detected and not yet saved if Track Changes option is set

Track Changes After Save
Color to display in left margin when a a change is detected and saved if Track Changes option is set

Search Line Highlight
Background Color used to highlight a search (double click in search results or highlight found search terms)

URL
Foreground color of a detected Internet Link in the editor

Function Separator
Color of the thin line used to separate found functions if Show Function Separators is set

Outline
Color of the thin line used to draw in the outline tree in the left margin

Error Underline
Color used for underline spelling erros in the text

Right Line
Color of the thin line drawn when Right Line is set
Note: Indentation color and tab arrow will also be drawn using this color

End of File
Color of the thin line drawn in the end of text when End Of File Line is set

Left Margin
Background color of the left margin

Beyond Right Line
Background color of right margin, if Right Line is set

Indent Guides and Tabs
Color for the line of the indent tabs and the small tab graphic (arrow)


Auto Complete Preferences

This section allows you to customize which keywords will be used when invoking Auto Complete and how many backwards lines will be scanned.


Auto Correct Preferences

If enabled, Auto Correct will replace words for words or sentences.

Simply fill the list with words you want to be automatically replaced.

for instance, you might want, every time you write the "(c)" word, that it will be replaced by the proper copyright symbol "©".
Write (c) in the replace text box and either past the © Symbol or press ALT+169. Click Add.
Every time a "(c)" is written it will be automatically replaced by ©


Snippets

Introduction

Snippets are reusable blocks of code always available at your fingertips. Any text can be used as code snippet, like programs skeletons, frequent address's, javascript samples and much more.

Usage

To use Snippets in Twistpad press Ctrl-J (Please note the shortcut can easily changed to suit your needs) anywhere in the code editor and a listbox similar to auto complete pop's up. All you have to do is choose which is the snippet to use using the mouse or the keyboard and the snippet is instantly inserted at the cursor location.

Configuration

Snippets are text files which are stored in the Snippets folder in the applications file data folders with "TSF" extension. To create a new snippet simple save the new created file into the "datafolder"\snippets folder. It will be available the next time you press the "Insert Snippet" shortcut

If a syntax file have a Snippet defined in the header (or multiple separated by the | symbol) Twistpad will only use the snippets declared in the header.
In the [::Header::] section of a syntax file, the entry Snippet can be used to contain one or more snippet filenames
example:

snippet=A Sample.tsf
or multiple
Snippet=snippet1.tsf|snippet2.tsf|snippet3.tsf

File description

The Snippets file's are plain text files, so if you need to create a new one, or edit a existing one, simply open it in Twistpad! (a Special Syntax file is supplied for easier editing of snippets)

Sample Snippet file:
Snippet Title

T=Simple Snippet
This is a sample snippet

T=Snippet with hotspot
the cursor will be inserted between here ^\ and here

T=Snippet with multiple lines
Several Lines can
be added
and the formatting
will be preserved in the Twistpad editor
In the first line is where the Snippet title is, this will be used to identify a snippet file.
Each Snippet is defined by a starting T= with a sample title text.
Every line after the title will be interpreted as a the Snippet text until it finds another Snippet header or the end of file.

The hotspot can be used in two ways, if a snippets has the following symbols ^\ it means that the cursos will move to that place when inserted in Twistpad editor or, if text is selected, it will be used instead of the symbol ^\ A Snippet can omit this symbol.

Please note the space between snippets is not required and is just used to make the sample easier to read


Keyboard Macros

Twistpad has special macros, called Keyboard Macros.
Keyboard macros recording repetitive keyboard tasks, which later, or after recording, can be playback a specified number of times.

Usage

After pressing the Record command from the Tools \ Keyboard Macros menu, the mouse cursor will change to contain a tape image, this means your key actions are being recorded. press the keys you would like to record in the macro, and stop the recording by clicking again on the recording button. Twistpad will prompt for the name of the macro. If you cancel at this time, the macro will not be saved, Enter the new macro name and optionally a description and press OK.

To playback, again select in Playback in Tools \ Keyboard Macros menu. Select the macro you wish to use specifying how many times you would like to repeat the macro. If you choose "until end of document" the macro will be repeated until it reachs the last line of the document. press OK.
You cancel a playback at any time pressing the Escape key.

Temporary macros

Optionally you can Record a temporary macro using the respective command. The only difference, is that when the recording is stoped, Twistpad will not prompt for save the macro. You can quickly playback using the Play Temporary Macro Command or using the normal Playback Macro command, ensuring the macro to record is the temporary.

File Details

Macro Files are stored in the "Current User folder"\Application Data\Carthago\Twistpad\Macros folder.
This files should not be edited, but can be deleted in order to remove old macros not in use anymore.


Sdf File Definition

Introduction

The syntax file (SDF) is the heart of syntax specific capabilities of Twistpad.
All SDF files are located in the sub-folder "Syntax" of the main Twistpad folder.
It's the SDF files which define how a syntax is applied to a particular file (identified by it's extension)

The syntax of the SDF file is very similar to a standard Windows INI file. If you are familiar with this type of file, it should be easier to edit SDF files.
Although a very complex file syntax can be archived in Twistpad, the ease of creation of a new syntax it's one of the many strengths you can find in Twistpad. In 2 minutes you can create a new syntax file, simply based on keywords.
There are 3 main blocks in a SDF file, the [::Header::] which can be only one, and is not optional, and several sets of optional keywords and start-stop sections.

Header section

The header section is required to proper enable syntax for a specific file type in Twistpad.
The header is always : [::Header::]
The keywords for the Header section are:
  • SyntaxName*: The name of the syntax
  • Extensions*: The file extensions where this syntax is applied
  • Functions: Regular expression to define functions or sections
  • FunctionSubs: Regular expression to retrieve RE groups (between brackets). If ommited the full line context will be displayed
  • HelpFile: One or more Help files for use with this syntax (multiple can be used with the | sign)
  • Spelling: 1 or 0. When 0, means spell nothing, except in the contexts defined in the SpellingContexts keyword, if 1 spell everything except in the contexts defined in the SpellingContexts keyword**
  • SpellingContexts: Coma delimited contexts, it's use is defined in the Spelling keyword
  • SnippetFile: Snippet file to use in the syntax
  • Delimiters: custom delimiters for this syntax (please note a spaces and tabs are always considered delimiters)
  • CommentChar: Character (or a multiple characters) to be used in comment/uncomment commands
  • CommentCharEnd: Character (or a multiple characters) to be used in comment/uncomment commands. If CommentCharEnd is omitted, comments will be applied on a line by line basis (using the character defined in CommentChar)
  • Template: A path to a file that will be inserted when the new command is executed for this file type (if the complete path is not given Twistpad will look in both template folder's)
  • KeywordsSeparator: Define which is the character that will be used as the separator for syntax files (if omitted ; will be used)
  • Brackets: Define which characters are considered brackets. Only the start bracket of the choices: "({<[" is required. Default value are the the 4 brackets.

Sections

There are two types of sections, Start-Stop Sections and Keywords Section.
Start-Stop Sections define a text color/format for, as the name implies, a block of text with recognized tokens. for instance you could say you want everything that starts with { and ends with } in blue.
Keywords define a single word which is to be colored, for instance, you might want that the word "Blue" appears in blue.
Both have the following Keywords:
  • Type*: StartStop or Keyword
  • Context*: a unique number that identifies this StartStop ID
  • Scope*: Defines a context where this context is active
  • Priority*: or importance of this keyword/StartStop, higher numbers means higher priority in displaying the context
  • WholeWordOnly*: 1 or 0, if 1 the word separator has to be one of the delimiters, if not the word separators are ignored
  • CaseSensitive:1 or 0, Denotes if the StartStop Keys or the Keywords should be treated as case sensitive (1) or not (0)
  • BeginParagraph:1 or 0, Denotes if the StartStop Keys or the Keywords should be only activated if they are the first word in a paragraph
  • StartOfParagraph:1 or 0, Denotes if the StartStop Keys or the Keywords should be only activated if they start at the beginning of a paragraph
  • Background*:Color of the background, in HEX style (use insert color) or Default for default background color
  • Foreground*:Color of the foreground, in HEX style (use insert color) or Default for default foreground color
  • Bold:0 or 1, to make words in bold
  • Italic:0 or 1, to make words in italic

Specific StartStop Keywords

  • First: The first word to define the start section
  • Last: The last word to define the stop section
  • Outline: 0 or 1, defines whether this section can be closed
  • Smart: 0 or 1, defines if the stop section is incremented, for example to find a matching pair of { when smart is enabled, any closing sections are ignored if more open sections are found
  • EscapeChar: Defines the character used to cancel a start or stop section

Specific Keywords Keywords

  • Keyword1 to Keyword16: The keywords are defined here, separated by a ; or the separator defined in the ::header:: section
  • (eg. Keyword1=key1;key2;key3;key4)

Example

As a simple example let's say that you wish to have the words Twistpad, Syntax and File in blue.
Also everything between { and } in bold red. And as a final touch in our example let's define the word Color to be displayed in green only when it's between { and }.
Point to new file in Twistpad, create the header that should be something like:

[::Header::]
SyntaxName=Test syntax
extensions=tst
Now, as a rule, although this is not required, you should declare the start stop sections first. So we need to declare the brackets section

[Brackets]
Type=StartStop
Context=1
Scope=0
Priority=7
First={
Last=}
Background=Default
Foreground=FF0000
Bold=1
Now on to the keywords:

[BlueKeywords]
Type=keyword
Context=100
Scope=0
Priority=6
WholeWordOnly=1
Keyword1=Twistpad;Syntax;File
Background=Default
Foreground=0000FF

[GreenColorOnBrackets]
Type=keyword
Context=101
Scope=1
Priority=6
WholeWordOnly=1
Keyword1=Color
Background=Default
Foreground=008000

Notice the scope set to 1 on [GreenColorOnBrackets], this is to force the use of this style only in context 1 (between brackets)

Save the file as Test.sdf on the Syntax sub-folder of Twistpad and open a file with the tst extension to test the syntax just created.

Tips

The best way to make a new syntax is to modify an existing one, you can find all syntax definition files used by Twistpad in the sub folder "Syntax" in the "All Users Application Data" folder (Or double click the syntax screen on the Twistpad preferences dialogue).
In the Carthago Software Site, you may find more syntax files, the chances are you will not need to create any SDF file, as someone might already created it!

Notes

* Denotes a required keyword
** Context's are explained in the StartStop and Keywords section


Syntax Highlight

Syntax Highlighting in Twistpad is archived via configuration files with the .sdf extension located in the \syntax subfolder of the Twistpad install dir.
please refer to syntax definition files topic for information on how to create and edit new syntax definitions.


Templates

Introduction

Twistpad supports simple document templates.
A Document template is pre-prepared document for common tasks. Ie. you might want to have a body template of your web-page, or a common file in computer programming tasks.

Usage

To create a new document based on an existing template, select New from the File Menu, and select the templates folder in the tree at the left. The available templates will be displayed in a list on the right, select the one you wish and press 'OK'

Configuration

Templates reside in the applications file data folders. To delete an existing template, simply open the folder in Windows Explorer and delete the specified file. To edit an existing template, open it with Twistpad, make the modifications and save the file. When Creating a new template, edit or open a new file and save it with the command "Save As Template". It will be available for selection when pressing New of the File Menu


File Data Locations

Twistpad requires a series of additional files to work properly.
This files can easily be edited by any user and conforms to the specification by Microsoft on where additional data files reside in the system.

The following folders are used:
"Documents and settings Folder"\All Users\application Data\Carthago\Twistpad :
Dictionaries, Plug-ins, Snippets, Syntax and Templates this will be shared by any user using the computer.

"Documents and settings Folder"\application Data\Carthago\Twistpad :
Main file configuration*, Macros, Recover and optionally Snippets and templates will reside here, and will be visible only to the current user.

In Windows XP and 2000 the "Documents and settings Folder" is usually "c:\Documents and Settings". But this might change in new versions of Windows.

Portable mode*

When running Twistpad in portable mode, All files are stored and accessed in the main folder of Twistpad.

* Twistpad 1.62 or higher.


Portable Mode

Twistpad can operate in a portable mode, not requiring installation, nor leaving traces in the host system.

A special purpose application is available for registered users. Refer to the registration confirmation e-mail received upon purchase of a Twistpad license on where to download.

This application copies your current Twistpad version and settings installed in the local system to a specified path (usually a USB pen drive).

Note: Adicional add-on's and/or plugin's may not be compatible with Twistpad in Portable mode. Refer to each plugin documentation you pretend to use, about it's portability compatibility


Compare Files

The compare results window will show the two files side by side and the differences are show with colors customized in Compare Preferences.

The toolbar buttons allows to open another set of files, find text, go to a line, bookmark lines, quickly jump between found differences and refresh (execute) the compare results again.


Default Shortcuts

Default Shortcuts (Customizable)

Note: Twistpad offers the ability customize keyboard shortcuts, this list is only applicable to the default shortcuts.

New | Ctrl-N
New Text File | Ctrl-Shift-N
Revert | Ctrl-R
Save "Document" | Ctrl-S
Save All | Ctrl-Alt-S
Close | Ctrl-F4
Print | Ctrl-P
Exit | Alt-F4
Undo | Ctrl-Z
Redo | Shift-Ctrl-Z
Cut | Ctrl-X
Copy | Ctrl-C
Paste | Ctrl-V
Paste New | Ctrl-Alt-V
Paste Multiple | Shift-Ctrl-V
Select All | Ctrl-A
Select Function | Shif+Ctrl+M
Select Word | Ctrl+W
Delete | Del
Delete Line | Ctrl+Y
Comment Block | Ctrl-K
Uncomment Block | Ctrl-L
Indent Block | Tab
Unindent Block | Shift-Tab
Insert Snippet | Ctrl-J
Move Line/Block up | Shift+Ctrl+Up
Move Line/Block down | Shift+Ctrl+Down
Expand Current Block | Ctrl++
Collapse Current Block | Ctrl+-
Expand All | Shift+Ctrl++
Collapse All | Shift+Ctrl+-
Find | Ctrl+F
Find Bar Focus | Ctrl-D
Find Again Forward | F3
Find Again Backward | Shift+F3
Quick Find Forward | F4
Quick Find Backward | Shift+F4
Incremental Search | Ctrl+I
Replace | Ctrl+H
Find in Files | Shift+Ctrl+F
Replace in Files | Shift+Ctrl+H
Go To | Ctrl+G
Toggle Bookmark | Ctrl+F2
Next Bookmark | F2
Previous Bookmark | F2
Clear Bookmarks | Shift+Ctrl+F2
List Bookmarks | F2
Find Functions | F8
Match Bracket | Ctrl+M
Spelling | F7
Full Screen | F11
Help Topics | F1
Syntax Sensitive Help | Shift+F1

Fixed Shortcuts

Auto-Complete | Ctrl+Space
Editor View Up | Ctrl+up
Editor View Down | Ctrl+Down
Alternate Copy | Ctrl+Ins
Alternate Cut | Shift+Delete
Arrow Keys | Move Cursor
Smart New Line Up | Ctrl+Enter
Smart New Line Down | Shift+Enter


Regular Expressions

Introduction

Regular Expressions are a widely-used method of specifying patterns of text to search for. Special metacharacters allow You to specify, for instance, that a particular string You are looking for occurs at the beginning or end of a line, or contains n recurrences of a certain character.

Regular expressions look ugly for novices, but really they are very simple, handy and powerful tool.

Simple matches

Any single character matches itself, unless it is a metacharacter with a special meaning described below.
A series of characters matches that series of characters in the target string, so the pattern "bluh" would match "bluh'' in the target string.
You can cause characters that normally function as metacharacters or escape sequences to be interpreted literally by 'escaping' them by preceding them with a backslash "\", for instance: metacharacter "^" match beginning of string, but "\^" match character "^", "\\" match "\" and so on.

Examples:
foobar match's string 'foobar'
\^FooBarPtr match's '^FooBarPtr'

Escape sequences

Characters may be specified using a escape sequences syntax much like that used in C and Perl: "\n'' matches a newline, "\t'' a tab, etc. More generally, \xnn, where nn is a string of hexadecimal digits, matches the character whose ASCII value is nn. If You need wide (Unicode) character code, You can use '\x{nnnn}', where 'nnnn' - one or more hexadecimal digits.

\xnn char with hex code nn
\x{nnnn} char with hex code nnnn (one byte for plain text and two bytes for Unicode)
\t tab (HT/TAB), same as \x09
\n newline (NL), same as \x0a
\r car.return (CR), same as \x0d
\f form feed (FF), same as \x0c
\a alarm (bell) (BEL), same as \x07
\e escape (ESC), same as \x1b
Examples:
foo\x20bar match's 'foo bar' (note space in the middle)
\tfoobar matchs 'foobar' predefined by tab

Character classes

You can specify a character class, by enclosing a list of characters in [], which will match any one character from the list.

If the first character after the "['' is "^'', the class matches any character not in the list.

Examples:
foob[aeiou]r finds strings 'foobar', 'foober' etc. but not 'foobbr', 'foobcr' etc.
foob[^aeiou]r find strings 'foobbr', 'foobcr' etc. but not 'foobar', 'foober' etc.
Within a list, the "-'' character is used to specify a range, so that a-z represents all characters between "a'' and "z'', inclusive.

If You want "-'' itself to be a member of a class, put it at the start or end of the list, or escape it with a backslash. If You want ']' you may place it at the start of list or escape it with a backslash.

Examples:
[-az] match's 'a', 'z' and '-'
[az-] match's 'a', 'z' and '-'
[a\-z] match's 'a', 'z' and '-'
[a-z] match's all twenty six small characters from 'a' to 'z'
[\n-\x0D] match's any of #10,#11,#12,#13.
[\d-t] match's any digit, '-' or 't'.
[]-a] match's any char from ']'..'a'.

Metacharacters

Metacharacters are special characters which are the essence of Regular Expressions. There are different types of metacharacters, described below.

Metacharacters - line separators

^ start of line
$ end of line
\A start of text
\Z end of text
. any character in line
Examples:
^foobar match's string 'foobar' only if it's at the beginning of line
foobar$ match's string 'foobar' only if it's at the end of line
^foobar$ match's string 'foobar' only if it's the only string in line
foob.r match's strings like 'foobar', 'foobbr', 'foob1r' and so on

Metacharacters - predefined classes

\w an alphanumeric character (including "_")
\W a nonalphanumeric
\d a numeric character
\D a non-numeric
\s any space (same as [ \t\n\r\f])
\S a non space
You may use \w, \d and \s within custom character classes.

Examples:
foob\dr match's strings like 'foob1r', ''foob6r' and so on but not 'foobar', 'foobbr' and so on
foob[\w\s]r match's strings like 'foobar', 'foob r', 'foobbr' and so on but not 'foob1r', 'foob=r' and so on

Metacharacters - word boundaries

\b Match a word boundary
\B Match a non-(word boundary)
A word boundary (\b) is a spot between two characters that has a \w on one side of it and a \W on the other side of it (in either order), counting the imaginary characters off the beginning and end of the string as matching a \W.

Metacharacters - iterators

Any item of a regular expression may be followed by another type of metacharacters - iterators. Using this metacharacters You can specify number of occurrences of previous character, metacharacter or sub expression.

* zero or more ("greedy"), similar to {0,}
+ one or more ("greedy"), similar to {1,}
? zero or one ("greedy"), similar to {0,1}
{n} exactly n times ("greedy")
{n,} at least n times ("greedy")
{n,m} at least n but not more than m times ("greedy")
*? zero or more ("non-greedy"), similar to {0,}?
+? one or more ("non-greedy"), similar to {1,}?
?? zero or one ("non-greedy"), similar to {0,1}?
{n}? exactly n times ("non-greedy")
{n,}? at least n times ("non-greedy")
{n,m}? at least n but not more than m times ("non-greedy")
So, digits in curly brackets of the form {n,m}, specify the minimum number of times to match the item n and the maximum m. The form {n} is equivalent to {n,n} and matches exactly n times. The form {n,} matches n or more times. There is no limit to the size of n or m, but large numbers will chew up more memory and slow down r.e. execution.

If a curly bracket occurs in any other context, it is treated as a regular character.

Examples:
foob.*r match's strings like 'foobar', 'foobalkjdflkj9r' and 'foobr'
foob.+r match's strings like 'foobar', 'foobalkjdflkj9r' but not 'foobr'
foob.?r match's strings like 'foobar', 'foobbr' and 'foobr' but not 'foobalkj9r'
fooba{2}r match's the string 'foobaar'
fooba{2,}r matchs strings like 'foobaar', 'foobaaar', 'foobaaaar' etc.
fooba{2,3}r match's strings like 'foobaar', or 'foobaaar' but not 'foobaaaar'
A little explanation about "greediness". "Greedy" takes as many as possible, "non-greedy" takes as few as possible. For example, 'b+' and 'b*' applied to string 'abbbbc' return 'bbbb', 'b+?' returns 'b', 'b*?' returns empty string, 'b{2,3}?' returns 'bb', 'b{2,3}' returns 'bbb'.

You can switch all iterators into "non-greedy" mode using the (?g) switch

Metacharacters - alternatives

You can specify a series of alternatives for a pattern using "|'' to separate them, so that fee|fie|foe will match any of "fee'', "fie'', or "foe'' in the target string (as would f(e|i|o)e). The first alternative includes everything from the last pattern delimiter ("('', "['', or the beginning of the pattern) up to the first "|'', and the last alternative contains everything from the last "|'' to the next pattern delimiter. For this reason, it's common practice to include alternatives in parentheses, to minimize confusion about where they start and end.
Alternatives are tried from left to right, so the first alternative found for which the entire expression matches, is the one that is chosen. This means that alternatives are not necessarily greedy. For example: when matching foo|foot against "barefoot'', only the "foo'' part will match, as that is the first alternative tried, and it successfully matches the target string. (This might not seem important, but it is important when you are capturing matched text using parentheses.)
Also remember that "|'' is interpreted as a literal within square brackets, so if You write [fee|fie|foe] You're really only matching [feio|].

Examples:
foo(bar|foo) match's strings 'foobar' or 'foofoo'.

Metacharacters - sub expressions

The bracketing construct ( ... ) may also be used for define r.e. sub expressions.
Sub expressions are numbered based on the left to right order of their opening parenthesis.
First sub expression has number '1'

Examples:
(foobar){8,10} match's strings which contain 8, 9 or 10 instances of the 'foobar'
foob([0-9]|a+)r match's 'foob0r', 'foob1r' , 'foobar', 'foobaar', 'foobaar' etc.

Metacharacters - backreferences

Metacharacters \1 through \9 are interpreted as backreferences. \<n> matches previously matched sub expression #<n>.

Examples:
(.)\1+ match's 'aaaa' and 'cc'.
(.+)\1+ also match 'abab' and '123123'
(['"]?)(\d+)\1 match's '"13" (in double quotes), or '4' (in single quotes) or 77 (without quotes) etc

Perl extensions

You may use it into r.e. for modifying modifiers by the fly. If this construction inlined into sub expression, then it effects only into this sub expression

Examples:
(?i)Saint-Petersburg match's 'Saint-petersburg' and 'Saint-Petersburg'
(?i)Saint-(?-i)Petersburg match's 'Saint-Petersburg' but not 'Saint-petersburg'
(?i)(Saint-)?Petersburg match's 'Saint-petersburg' and 'saint-petersburg'
((?i)Saint-)?Petersburg match's 'saint-Petersburg', but not 'saint-petersburg'

Common Examples

Find An HTML Color Hex Value:
(?G)\#[a-fA-F0-9]{3,6} Matchs #FFA and #FF00FF

Find a Percentage:
[\+\-]?[\.]?[0-9]+[\.]?[0-9]*\% Matchs 12% and 100%

Find an e-mail:
(?G)[\w\d\-\.]+@[\w\d\-]+(\.[\w\d\-]+)+ Matchs testing@test.com


Wildcards

Wildcard characters are keyboard characters such as an asterisk (*) or the question mark (?) that is used to represent one or more characters when you are searching or filtering for files.

Wildcard characters are often used in place of one or more characters when you do not know what the real character is or want to process a group of files.

e.g.:
  • *.html - Only files with the extension HTML will be considered
  • p*.* - Only files which start with a P will be considered
  • *.html;*.css - Only files with extensions HTML and CSS will be considered
  • *.* - All files will be considered
  • sales.htm - Only files with the exactly named "sales.htm" will be considered (no wildcards used in this case)


Twistpad Help

Search Results Window

Twistpad uses the MDI (multiple document interface) concept.
This allows multiple documents to be opened at the same time which can be switched to easily with the switch bar: